import request from '@/utils/request'

// 查询列表
export function listBusinessManagement(query) {
    return request({
        url: '/project/business/list',
        method: 'get',
        params: query
    })
}

// 查询列表
export function listNoReportNoList(query) {
    return request({
        url: '/project/business/noReportNoList',
        method: 'get',
        params: query
    })
}

// 查询列表
export function listNoAgencyNoList(query) {
    return request({
        url: '/project/business/noAgencyNoList',
        method: 'get',
        params: query
    })
}

// 查询列表
export function listNoCostNoList(query) {
    return request({
        url: '/project/business/noCostNoList',
        method: 'get',
        params: query
    })
}


//编辑
export function addBusinessManagement(data) {
    return request({
        url: '/project/business',
        method: 'post',
        data: data
    })
}

//编辑
export function updateBusinessManagement(data) {
    return request({
        url: '/project/business',
        method: 'put',
        data: data
    })
}

//迁移项目列表
export function migrationList(query) {
    return request({
        url: '/project/business/migrationList',
        method: 'get',
        params: query
    })
}


//迁移
export function migrateBusinessManagement(data) {
    return request({
        url: '/project/business/migration',
        method: 'put',
        data: data
    })
}

//获取业务主页的路由
export function getBusinessRoute(id) {
    return request({
        url: '/business/menu/bmsMenuTreeselect/' + id,
        method: 'get'
    })
}

// 归档模板列表
export function listDocArchive(projectId) {
    return request({
        url: '/project/business/docArchiveList/' + projectId,
        method: 'get'
    })
}

//招标选人显示
export function isShowEngineeringBidding(id) {
    return request({
        url: '/project/business/isEngineeringBidding/' + id,
        method: 'get'
    })
}

//招标组组长和组员选择列表
export function tenderList(query) {
    return request({
        url: '/project/business/tenderList',
        method: 'get',
        params: query
    })
}

//获取业务类别
export function businessTreeSelect(projectId) {
    return request({
        url: '/project/business/getServiceBussinessTypes/' + projectId,
        method: 'get'
    })
}

//判断本项目是否包含该业务类别
export function checkProject(projectId,businessId) {
    return request({
        url: '/project/business/checkProject/' + projectId+'/'+businessId,
        method: 'get'
    })
}

//判断本业务是否能发起流程
export function checkBusiness(projectId,businessTypeId) {
    return request({
        url: '/project/business/checkBusiness/' + projectId+'/'+businessTypeId,
        method: 'get'
    })
}

// 检查本项目下业务名称是否重复
export function checkBussinessNameSingle(query) {
    return request({
        url: '/project/business/checkBussinessNameSingle',
        method: 'get',
        params: query
    })
}

// 查询列表
export function getReportType(businessTypeId) {
    return request({
        url: '/project/business/getReportType/' + businessTypeId,
        method: 'get',
        params: businessTypeId
    })
}

export function getNewAndOldProjectInfo(newProjectId,oldProjectId,businessId) {
    return request({
        url: '/project/business/getNewAndOldProjectInfo/' + newProjectId+'/'+oldProjectId+'/'+businessId,
        method: 'get'
    })
}

// 获取报告类型数量
export function getReportTypeCounts(businessTypeId) {
    return request({
        url: '/project/business/getReportTypeCounts/' + businessTypeId,
        method: 'get'
    })
}

export function cancelBusiness(data) {
    return request({
        url: '/project/business/cancelBusiness',
        method: 'post',
        data: data
    })
}

export function checkWorkflow(data) {
    return request({
        url: '/project/business/checkWorkflow',
        method: 'post',
        data: data
    })
}

// 取消流程
export function cancelInstance(businessId) {
    return request({
        url: '/project/business/cancelInstance/' + businessId,
        method: 'get'
    })
}


// 查询列表
export function listBusinessOper(query) {
    return request({
        url: '/projectWorkbench/businessOper/list',
        method: 'get',
        params: query
    })
}